package com.atguigu.baku.controller;


import com.atguigu.baku.service.AreaCityService;
import com.atguigu.baku.vo.AreaCityVo;
import com.atguigu.baseservice.result.R;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author dayouzi
 * @since 2022-11-10
 */
@RestController
@RequestMapping("/baku/area-city")
@CrossOrigin
public class AreaCityController {

    @Autowired
    private AreaCityService areaCityService;

    @ApiOperation(value = "省份城市")
    @GetMapping("/areaCity")
    public R getAreaCity() {
        List<AreaCityVo> list = areaCityService.getAreaCity();
        return R.ok().data("items", list);
    }

}

